define(["jquery", "jquery.mobile", "app/url"],
    function($, mobile, url) {
    return new function(p) { this.__proto__ = p; } ({
        init : function() {
            console.log("gnomus.init()");
            url.init();
        },

        changePageSmart : function() {
            var first = url.getFirst();
            if (first === "home") {
                this.loadPage(first);
            } else if (first === "be") {
                require(["activity/be"], function(be) {
                    be.init();
                })
            }
        },

        loadPage : function(page_id) {
            $.ajax({
                url : "/html/" + page_id + ".html",
                success : function(response) {
                    $(":jqmData(role=page)").append(response);
                }
            });
        }
    });
});